package oa.hleast.xswl.controller.admin.questionnaire;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import oa.hleast.common.result.Result;
import oa.hleast.xswl.pojo.vo.questionnaire.UserQuestionnaireResultVo;
import oa.hleast.xswl.service.questionnaire.UserQuestionnaireService;
import org.springframework.web.bind.annotation.*;


@Api(tags = "【系统管理】用户抗压测试管理")
@RestController("AdminUserQuestionnaireController")
@RequestMapping("/api.admin/v1/questionnaires")
@Slf4j
@AllArgsConstructor
public class UserQuestionnaireController{

    private final UserQuestionnaireService userQuestionnaireService;

    /**
     * 应聘者抗压测试结果
     */
    public Result<UserQuestionnaireResultVo> getUserQuestionnaireResult(@RequestParam Long userId){

        UserQuestionnaireResultVo vo = userQuestionnaireService.getUserQuestionnaireResult(userId);
        return Result.success();
    }

    @ApiOperation(value = "抗压测试结果预览", httpMethod = "GET")
    @ApiImplicitParam(name = "userId", value = "userId", required = true, paramType = "path", dataType = "String",dataTypeClass = String.class)
    @GetMapping("/select/{userId}")
    public Result select(@PathVariable("userId") String userId) {
        return Result.success(userQuestionnaireService.getUserQuestionnaireResult(Long.valueOf(userId)));
    }


}
